export const getLineOptions = () => ({
  title: {
    text: '{title}',
    left: 'center',
    textStyle: {
      fontSize: 18,
      fontWeight: 'bold',
    },
  },
  tooltip: {
    trigger: 'axis',
    backgroundColor: 'rgba(0, 0, 0, 0.7)',
    borderColor: '#333',
    textStyle: {
      color: '#fff',
    },
  },
  legend: {
    data: ['{seriesName}'],
    top: 30,
    textStyle: {
      fontSize: 12,
    },
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    top: '80',
    containLabel: true,
  },
  toolbox: {
    feature: {
      saveAsImage: {
        title: '保存为图片',
        pixelRatio: 2,
      },
      dataView: {
        title: '数据视图',
        readOnly: false,
      },
    },
    top: 30,
    right: 20,
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: [],
    axisLine: {
      lineStyle: {
        color: '#666',
      },
    },
    axisLabel: {
      color: '#666',
      rotate: 45,
    },
  },
  yAxis: {
    type: 'value',
    axisLine: {
      show: true,
      lineStyle: {
        color: '#666',
      },
    },
    axisLabel: {
      color: '#666',
      formatter: '{value}',
    },
    splitLine: {
      lineStyle: {
        type: 'dashed',
        color: '#ddd',
      },
    },
  },
  series: [
    {
      name: '{seriesName}',
      type: 'line',
      data: [],
      smooth: true,
      symbol: 'circle',
      symbolSize: 6,
      itemStyle: {
        color: '#5470c6',
        borderWidth: 2,
      },
      lineStyle: {
        width: 3,
        color: '#5470c6',
      },
      areaStyle: {
        color: 'rgba(84, 112, 198, 0.3)',
      },
    },
  ],
  animation: true,
  animationDuration: 1000,
  animationEasing: 'cubicInOut',
})
